<template>
  <d2-container>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <!-- <el-tab-pane label="柜台账户管理" name="first">
        <v-Counter_account_management></v-Counter_account_management>
      </el-tab-pane> -->
      <el-tab-pane label="期初数据导入" name="first">
        <v-data_import></v-data_import>
      </el-tab-pane>
      <el-tab-pane label="柜台资金管理" name="second">
        <v-Funds_management></v-Funds_management>
      </el-tab-pane>
      <el-tab-pane label="柜台成交管理" name="third">
        <v-Transaction_management></v-Transaction_management>
      </el-tab-pane>
      <el-tab-pane label="柜台账户持仓明细" name="fourth">
        <v-Holdings_subsidiary></v-Holdings_subsidiary>
      </el-tab-pane>
      <el-tab-pane label="子账户结算单查询" name="fifth">
        <v-Counter_account_management_son></v-Counter_account_management_son>
      </el-tab-pane>
      <el-tab-pane label="费用管理" name="sixth">
        <v-expense_management></v-expense_management>
      </el-tab-pane>
    </el-tabs>
  </d2-container>
</template>
<script>
import data_import from './components/Counter_account_management/data_import'  // 期初数据导入
import Funds_management from './components/Counter_account_management/Funds_management' //柜台资金管理
import Transaction_management from './components/Counter_account_management/Transaction_management'   //柜台成交管理
import Holdings_subsidiary from './components/Counter_account_management/Holdings_subsidiary'   //柜台账户持仓明细
import expense_management from './components/expense_management/expense_management'
// import Counter_account_management from './components/Counter_account_management/Counter_account_management'
import Counter_account_management_son from './components/Counter_account_management/Counter_account_management_son'
export default {
  data() {
    return {
      activeName: 'first',
    }
  },
  components: {
    'v-data_import': data_import,
    'v-Funds_management': Funds_management,
    'v-Transaction_management': Transaction_management,
    'v-Holdings_subsidiary': Holdings_subsidiary,
    // 'v-Counter_account_management': Counter_account_management,
    'v-Counter_account_management_son': Counter_account_management_son,
    'v-expense_management': expense_management,
  },
  mounted() {
    this.updateType();
  },
  methods: {
    updateType() {
      let activeTab = this.$route.query.table;
      // 判断activeTab的值，更改activeName的值
      if (activeTab === "first") {
        this.activeName = "first";
      } else if (activeTab === "second") {
        this.activeName = "second";
      } else if (activeTab === "third") {
        this.activeName = "third";
      } else if (activeTab === "fourth") {
        this.activeName = "fourth";
      } else if (activeTab === "fifth") {
        this.activeName = "fifth";
      } else if (activeTab === "sixth") {
        this.activeName = "sixth";
      }
    },
    handleClick(tab, event) {
      // console.log(tab, event)
    },
  },
}
</script>